package com.cskaoyan.mapper;

import com.cskaoyan.bean.PermissionRelation;
import com.cskaoyan.bean.vo.RolePermissionsApi;
import com.cskaoyan.bean.vo.RolePermissionsData;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author Fantasylkh
 */
@Mapper
public interface PermissionMapper {

    List<RolePermissionsData> selectAllPermissionFather();

    List<RolePermissionsData> selectChildrenById(Integer kid);

    List<RolePermissionsApi> selectApiByChildId(Integer kid);

    String[] selectApiByRoleId(int roleId);

    void deleteRelation(int id);

    void insertPermission(List<PermissionRelation> relations);

    String selectApiByPermission(String permission);

    String selectPermissionByApi(String api);
}
